package com.baizhi.elastic.controller;

import com.baizhi.elastic.dao.PostRepository;
import com.baizhi.elastic.entity.Post;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;


@Controller
public class PostControler {

	@Autowired
	private PostRepository postRepository;



	@RequestMapping("/test")
	public String singleTitle() {
		System.out.println(123);
		List<Post> posts = postRepository.selectPostByNameAndHighlightAndPageable("李", "先", 0, 10);
		posts.forEach(System.out::println);
		return "index";
	}

}
